import request from '@/utils/request';

/**
 * 发布评论
 */
export function publishCommentApi(data) {
  return request({
    url: '/comment',
    method: 'post',
    data
  });
}

/**
 * 删除评论
 */
export function deleteCommentApi(commentId) {
  return request({
    url: `/comment/${commentId}`,
    method: 'delete'
  });
}

/**
 * 获取评论列表
 */
export function getVideoCommentsApi(videoId, params) {
  return request({
    url: `/comment/video/${videoId}`,
    method: 'get',
    params
  });
}

/**
 * 添加一级评论addCommentApi
*/
export function addCommentApi(data) {
  return request({
    url: '/comment',
    method: 'post',
    data
  });
}


/**
 * 回复二级评论
*/
export function replyCommentApi(data) {
  return request({
    url: '/comment',
    method: 'post',
    data
  });
}

/**
 * 点赞评论 likeCommentApi
 */
export function likeCommentApi(commentId) {
  return request({
    url: `/comment/${commentId}/like`,
    method: 'post'
  });
}

